import thenFs from 'then-fs'

thenFs.readFile('./1.txt','utf8').catch( err => {
    console.log(err.message);
}).then( (res) => { console.log(res);} );

thenFs.readFile('./111.txt','utf8').then( (res) => { console.log(res);} ).catch( err =>{
    console.log(err.message);
})

const pros = [
    thenFs.readFile('./1.txt','utf8'),
    thenFs.readFile('./2.txt','utf8')
]
Promise.all(pros).then( ([r1,r2]) =>{
    console.log(r1,r2);
})

Promise.race(pros).then( res =>{
    console.log(res);
})